import { invoke } from '@tauri-apps/api/tauri';


// 获取文件路径
export async function getFilePath(): Promise<string> {
    const cmd = 'plugin:git_widget|get_file_path';
    const res = await invoke<string>(cmd, {});
    return res;
}

// 读取二进制
export async function readBinary(): Promise<Uint8Array> {
    const cmd = 'plugin:git_widget|read_binary';
    const res = await invoke<number[]>(cmd, {});
    return Uint8Array.from(res);
}

// 读取文本
export async function readText(): Promise<string> {
    const cmd = 'plugin:git_widget|read_text';
    const res = await invoke<string>(cmd, {});
    return res;
}
